﻿@inherits DemoWithResizableComponent

<div class="demo-description" id="NullableDate">
    <h2>
        <DemoNavLink Link="DateEdit#NullableDate" />Date Edit - Nullable Date
    </h2>
    <p>
        Do any of the following to clear the <a class="helplink" target="_blank" href="https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxDateEdit-1">Date Edit</a> (set its value to null):
    </p>
    <ul>
        <li>
            Delete the value in the editor.
        </li>
        <li>
            Click the <b>Clear</b> button. To display this button, set the <a class="helplink" target="_blank" href="https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxDateEdit-1.ClearButtonDisplayMode">ClearButtonDisplayMode</a> property to <b>Auto</b>.
        </li>
    </ul>
    <p>
        Use the <a class="helplink" target="_blank" href="https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxDateEdit-1.NullText">NullText</a> property to display placeholder text in the Date Edit when its value is null.
    </p>
</div>

<div class="card demo-card demo-card-shadow">
    <div class="card-header">
        <DemoToolbar @bind-SelectedSize="SizeMode" Title="Clear the date" />
    </div>
    <div class="card-body mw-480">
        <DxDateEdit @bind-Date="@DateTimeValue"
                    NullText="Select a date..."
                    ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto"
                    SizeMode="SizeMode"></DxDateEdit>
    </div>
</div>

<CodeSnippet_Editor_DateEdit_NullableDate/>

@code {
    DateTime? DateTimeValue { get; set; } = DateTime.Now;
}
